package com.hqj.controller;
import com.hqj.controller.vo.HomeAllVo;
import com.hqj.entity.FileList;
import com.hqj.service.FileListService;
import com.hqj.utils.ResultUtil;
import com.hqj.utils.ResultVO;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashSet;
import java.util.List;

/**
 * @author 黄啟军
 * @version 1.0
 * @date 2020/5/16/016
 */
@Api(tags = "FileListController")
@RestController
@RequestMapping("/fileList")
@CrossOrigin
public class FileListController {

    @Resource
    private FileListService fileListService;
    @ApiOperation("查询所有文件")
    @GetMapping("/findAll")
   public ResultVO<List<FileList>> findAll(){
        List<FileList> all = fileListService.findAll();
        if(all.isEmpty()){
            return ResultUtil.error();
        }
        return ResultUtil.success(all);
    }
}
